/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CargarJuicios.java
 *
 * Created on 29-abr-2013, 11:13:20
 */
package gui;

import controladores.ControladorPrincipal;
import io.Alumno;
import io.Juicio;
import java.util.ArrayList;
import java.util.Iterator;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author NiCo
 */
public class CargarJuicios extends javax.swing.JFrame {

    /** Creates new form CargarJuicios */
    public CargarJuicios() {
        initComponents();
        this.setLocationRelativeTo(null);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jComboBox2 = new javax.swing.JComboBox();
        jComboBox1 = new javax.swing.JComboBox();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jLabel3 = new javax.swing.JLabel();
        jDateChooser1 = new com.toedter.calendar.JDateChooser();
        jLabel9 = new javax.swing.JLabel();
        jComboBox3 = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jLabel10 = new javax.swing.JLabel();
        jComboBox4 = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        jDateChooser2 = new com.toedter.calendar.JDateChooser();
        jButton2 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable3 = new javax.swing.JTable();
        jLabel11 = new javax.swing.JLabel();
        jComboBox5 = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        jDateChooser3 = new com.toedter.calendar.JDateChooser();
        jButton3 = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTable4 = new javax.swing.JTable();
        jLabel12 = new javax.swing.JLabel();
        jComboBox6 = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        jDateChooser4 = new com.toedter.calendar.JDateChooser();
        jButton4 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTable5 = new javax.swing.JTable();
        jLabel13 = new javax.swing.JLabel();
        jComboBox7 = new javax.swing.JComboBox();
        jLabel7 = new javax.swing.JLabel();
        jDateChooser5 = new com.toedter.calendar.JDateChooser();
        jButton5 = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jTable6 = new javax.swing.JTable();
        jButton6 = new javax.swing.JButton();
        jLabel14 = new javax.swing.JLabel();
        jDateChooser6 = new com.toedter.calendar.JDateChooser();
        jLabel8 = new javax.swing.JLabel();
        jYearChooser1 = new com.toedter.calendar.JYearChooser();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);

        jLabel1.setText("Curso");

        jLabel2.setText("Grupo");

        jComboBox2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox2ActionPerformed(evt);
            }
        });

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Primero", "Segundo" }));
        jComboBox1.setSelectedIndex(-1);
        jComboBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox1ActionPerformed(evt);
            }
        });

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre alumno", "Juicio", "Nota", "F. Justificadas", "F. Injustificadas"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, true, true, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jTable1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jTable1PropertyChange(evt);
            }
        });
        jScrollPane1.setViewportView(jTable1);

        jLabel3.setText("Fecha");

        jDateChooser1.setDateFormatString("dd-MM-yyyy");

        jLabel9.setText("Materia");

        jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "I. Español", "Matemática", "Ingles", "Historia", "Geografía", "Biología", "C. Físicas", "Informática", "E.V.P.", "E.S.M.", "ECA", "Ed. Física" }));
        jComboBox3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox3ActionPerformed(evt);
            }
        });

        jButton1.setText("Guardar");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 641, Short.MAX_VALUE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel9)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jButton1)
                        .addGap(292, 292, 292))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel3)
                        .addComponent(jLabel9)
                        .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jDateChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton1)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("1era. Evaluación", jPanel1);

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre alumno", "Juicio", "Nota", "F. Justificadas", "F. Injustificadas"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, true, true, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane2.setViewportView(jTable2);

        jLabel10.setText("Materia");

        jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "I. Español", "Matemática", "Ingles", "Historia", "Geografía", "Biología", "C. Físicas", "Informática", "E.V.P.", "E.S.M.", "ECA", "Ed. Física" }));
        jComboBox4.setSelectedIndex(-1);
        jComboBox4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox4ActionPerformed(evt);
            }
        });

        jLabel4.setText("Fecha");

        jDateChooser2.setDateFormatString("dd-MM-yyyy");

        jButton2.setText("Guardar");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 641, Short.MAX_VALUE)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addComponent(jLabel10)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addComponent(jButton2)
                        .addGap(293, 293, 293))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel4)
                        .addComponent(jLabel10)
                        .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jDateChooser2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)
                .addComponent(jButton2)
                .addContainerGap())
        );

        jTabbedPane1.addTab("1era. Reunión", jPanel2);

        jTable3.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre alumno", "Juicio", "Nota", "F. Justificadas", "F. Injustificadas"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, true, true, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane3.setViewportView(jTable3);

        jLabel11.setText("Materia");

        jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "I. Español", "Matemática", "Ingles", "Historia", "Geografía", "Biología", "C. Físicas", "Informática", "E.V.P.", "E.S.M.", "ECA", "Ed. Física" }));
        jComboBox5.setSelectedIndex(-1);
        jComboBox5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox5ActionPerformed(evt);
            }
        });

        jLabel5.setText("Fecha");

        jDateChooser3.setDateFormatString("dd-MM-yyyy");

        jButton3.setText("Guardar");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 641, Short.MAX_VALUE)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel11)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel5)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jDateChooser3, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addComponent(jButton3)
                        .addGap(292, 292, 292))))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel5)
                        .addComponent(jLabel11)
                        .addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jDateChooser3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)
                .addComponent(jButton3)
                .addContainerGap())
        );

        jTabbedPane1.addTab("2da. Evaluación", jPanel3);

        jTable4.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre alumno", "Juicio", "Nota", "F. Justificadas", "F. Injustificadas"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, true, true, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane4.setViewportView(jTable4);

        jLabel12.setText("Materia");

        jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "I. Español", "Matemática", "Ingles", "Historia", "Geografía", "Biología", "C. Físicas", "Informática", "E.V.P.", "E.S.M.", "ECA", "Ed. Física" }));
        jComboBox6.setSelectedIndex(-1);
        jComboBox6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox6ActionPerformed(evt);
            }
        });

        jLabel6.setText("Fecha");

        jDateChooser4.setDateFormatString("dd-MM-yyyy");

        jButton4.setText("Guardar");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 641, Short.MAX_VALUE)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabel12)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jDateChooser4, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                        .addComponent(jButton4)
                        .addGap(291, 291, 291))))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel6)
                        .addComponent(jLabel12)
                        .addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jDateChooser4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)
                .addComponent(jButton4)
                .addContainerGap())
        );

        jTabbedPane1.addTab("2da. Reunión", jPanel4);

        jTable5.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre alumno", "Juicio", "Nota", "F. Justificadas", "F. Injustificadas"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, true, true, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane5.setViewportView(jTable5);

        jLabel13.setText("Materia");

        jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "I. Español", "Matemática", "Ingles", "Historia", "Geografía", "Biología", "C. Físicas", "Informática", "E.V.P.", "E.S.M.", "ECA", "Ed. Física" }));
        jComboBox7.setSelectedIndex(-1);
        jComboBox7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBox7ActionPerformed(evt);
            }
        });

        jLabel7.setText("Fecha");

        jDateChooser5.setDateFormatString("dd-MM-yyyy");

        jButton5.setText("Guardar");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 641, Short.MAX_VALUE)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel13)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboBox7, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel7)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jDateChooser5, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                        .addComponent(jButton5)
                        .addGap(290, 290, 290))))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel7)
                        .addComponent(jLabel13)
                        .addComponent(jComboBox7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jDateChooser5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)
                .addComponent(jButton5)
                .addContainerGap())
        );

        jTabbedPane1.addTab("3era. Evaluación", jPanel5);

        jTable6.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Nombre alumno", "Juicio"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane6.setViewportView(jTable6);

        jButton6.setText("Guardar");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jLabel14.setText("Fecha");

        jDateChooser6.setDateFormatString("dd-MM-yyyy");

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 641, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                        .addComponent(jButton6)
                        .addGap(290, 290, 290))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jDateChooser6, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(487, Short.MAX_VALUE))))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel14)
                    .addComponent(jDateChooser6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, Short.MAX_VALUE)
                .addComponent(jButton6)
                .addContainerGap())
        );

        jTabbedPane1.addTab("Juicios Generales", jPanel6);

        jLabel8.setText("Año");

        jYearChooser1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jYearChooser1PropertyChange(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 666, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(32, 32, 32)
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jYearChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(32, 32, 32)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel8))
                    .addComponent(jYearChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel2)))
                .addGap(18, 18, 18)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 404, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox1ActionPerformed
        int anio = jYearChooser1.getYear();
        DefaultComboBoxModel modelo = new DefaultComboBoxModel();
        Iterator<Integer> lista = ControladorPrincipal.getInstance().grupos(anio, jComboBox1.getSelectedItem().toString()).iterator();
        while (lista.hasNext()) {
            modelo.addElement(lista.next());
        }
        jComboBox2.setModel(modelo);
        jComboBox2.setSelectedIndex(-1);

        jDateChooser1.setDate(null);
        jDateChooser2.setDate(null);
        jDateChooser3.setDate(null);
        jDateChooser4.setDate(null);
        jDateChooser5.setDate(null);

        DefaultTableModel modeloT;
        modeloT = (DefaultTableModel) jTable1.getModel();
        int filas = modeloT.getRowCount();
        for (int i = 0; i < filas; i++) {
            modeloT.removeRow(0);
        }
        modeloT = (DefaultTableModel) jTable2.getModel();
        filas = modeloT.getRowCount();
        for (int i = 0; i < filas; i++) {
            modeloT.removeRow(0);
        }
        modeloT = (DefaultTableModel) jTable3.getModel();
        filas = modeloT.getRowCount();
        for (int i = 0; i < filas; i++) {
            modeloT.removeRow(0);
        }
        modeloT = (DefaultTableModel) jTable4.getModel();
        filas = modeloT.getRowCount();
        for (int i = 0; i < filas; i++) {
            modeloT.removeRow(0);
        }
        modeloT = (DefaultTableModel) jTable5.getModel();
        filas = modeloT.getRowCount();
        for (int i = 0; i < filas; i++) {
            modeloT.removeRow(0);
        }
        modeloT = (DefaultTableModel) jTable6.getModel();
        filas = modeloT.getRowCount();
        for (int i = 0; i < filas; i++) {
            modeloT.removeRow(0);
        }

    }//GEN-LAST:event_jComboBox1ActionPerformed

    private void jYearChooser1PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jYearChooser1PropertyChange
        if (evt.getPropertyName().equals("year")) {
            if (jComboBox1.getSelectedIndex() != -1) {
                int anio = jYearChooser1.getYear();
                DefaultComboBoxModel modelo = new DefaultComboBoxModel();
                Iterator<Integer> lista = ControladorPrincipal.getInstance().grupos(anio, jComboBox1.getSelectedItem().toString()).iterator();
                while (lista.hasNext()) {
                    modelo.addElement(lista.next());
                }
                jComboBox2.setModel(modelo);
                jComboBox2.setSelectedIndex(-1);

                jDateChooser1.setDate(null);
                jDateChooser2.setDate(null);
                jDateChooser3.setDate(null);
                jDateChooser4.setDate(null);
                jDateChooser5.setDate(null);

                DefaultTableModel modeloT;
                modeloT = (DefaultTableModel) jTable1.getModel();
                int filas = modeloT.getRowCount();
                for (int i = 0; i < filas; i++) {
                    modeloT.removeRow(0);
                }
                modeloT = (DefaultTableModel) jTable2.getModel();
                filas = modeloT.getRowCount();
                for (int i = 0; i < filas; i++) {
                    modeloT.removeRow(0);
                }
                modeloT = (DefaultTableModel) jTable3.getModel();
                filas = modeloT.getRowCount();
                for (int i = 0; i < filas; i++) {
                    modeloT.removeRow(0);
                }
                modeloT = (DefaultTableModel) jTable4.getModel();
                filas = modeloT.getRowCount();
                for (int i = 0; i < filas; i++) {
                    modeloT.removeRow(0);
                }
                modeloT = (DefaultTableModel) jTable5.getModel();
                filas = modeloT.getRowCount();
                for (int i = 0; i < filas; i++) {
                    modeloT.removeRow(0);
                }
                modeloT = (DefaultTableModel) jTable6.getModel();
                filas = modeloT.getRowCount();
                for (int i = 0; i < filas; i++) {
                    modeloT.removeRow(0);
                }
            }
        }
    }//GEN-LAST:event_jYearChooser1PropertyChange

    private void jComboBox3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox3ActionPerformed
        if (jComboBox1.getSelectedIndex() != -1 && jComboBox2.getSelectedIndex() != -1) {
            Iterator<Alumno> it = ControladorPrincipal.getInstance().alumnosDelGrupo(jComboBox1.getSelectedItem().toString(), Integer.parseInt(jComboBox2.getSelectedItem().toString()), jYearChooser1.getYear()).iterator();
            Alumno al;
            Object[] obj;
            DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();
            int filas = jTable1.getRowCount();
            for (int i = 0; i < filas; i++) {
                modelo.removeRow(0);
            }
            while (it.hasNext()) {
                al = it.next();
                Juicio juicio = ControladorPrincipal.getInstance().juicioAlumno(al, jComboBox3.getSelectedItem().toString(), 1, jYearChooser1.getYear());
                obj = new Object[5];
                if (juicio != null) {
                    obj[0] = al;
                    obj[1] = juicio.getJuicio();
                    obj[2] = juicio.getNota();
                    obj[3] = juicio.getJustificadas();
                    obj[4] = juicio.getInjustificadas();
                    jDateChooser1.setDate(juicio.getFecha());
                } else {
                    obj[0] = al;
                    jDateChooser1.setDate(null);
                }
                modelo.addRow(obj);
            }
        } else {
            JOptionPane.showMessageDialog(this, "Debe seleccionar el curso y el grupo", "Error", JOptionPane.ERROR_MESSAGE);
            jComboBox3.setSelectedIndex(-1);
        }
    }//GEN-LAST:event_jComboBox3ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        ArrayList<Juicio> juicios = new ArrayList<Juicio>();
        DefaultTableModel modelo = (DefaultTableModel) jTable1.getModel();
        int filas = jTable1.getRowCount();
        int largos = 0;
        Alumno al;
        if (jDateChooser1.getDate() != null) {
            for (int i = 0; i < filas; i++) {
                if (modelo.getValueAt(i, 1).toString().length() <= 160) {
                    try {
                        al = (Alumno) modelo.getValueAt(i, 0);
                        Juicio juicio = ControladorPrincipal.getInstance().juicioAlumno(al, jComboBox3.getSelectedItem().toString(), 1, jYearChooser1.getYear());
                        if (juicio != null) {
                            juicio.setFecha(jDateChooser1.getDate());
                            juicio.setInjustificadas((Integer) modelo.getValueAt(i, 4));
                            juicio.setJuicio(modelo.getValueAt(i, 1).toString());
                            juicio.setJustificadas((Integer) modelo.getValueAt(i, 3));
                            juicio.setNota((Integer) modelo.getValueAt(i, 2));
                            juicios.add(juicio);
                        } else {
                            Juicio nuevo = new Juicio();
                            nuevo.setAlumno(al);
                            nuevo.setFecha(jDateChooser1.getDate());
                            nuevo.setInjustificadas((Integer) modelo.getValueAt(i, 4));
                            nuevo.setJuicio(modelo.getValueAt(i, 1).toString());
                            nuevo.setJustificadas((Integer) modelo.getValueAt(i, 3));
                            nuevo.setNota((Integer) modelo.getValueAt(i, 2));
                            nuevo.setMateria(jComboBox3.getSelectedItem().toString());
                            nuevo.setReunion(1);
                            juicios.add(nuevo);
                        }
                    } catch (Exception e) {
                    }
                } else {
                    largos++;
                }
            }
            if (largos == 0) {
                if (juicios.size() == filas) {
                    for (int i = 0; i < filas; i++) {
                        ControladorPrincipal.getInstance().guardar(juicios.get(i));
                        modelo.removeRow(0);
                    }
                } else {
                    JOptionPane.showMessageDialog(this, "Existen datos incorrectos", "Error", JOptionPane.ERROR_MESSAGE);
                }
            } else {
                JOptionPane.showMessageDialog(this, "Existen juicios demasiado largos", "Error", JOptionPane.ERROR_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(this, "Debe seleccionar una fecha", "Error", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jButton1ActionPerformed
    private void jComboBox4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox4ActionPerformed
        if (jComboBox1.getSelectedIndex() != -1 && jComboBox2.getSelectedIndex() != -1) {
            Iterator<Alumno> it = ControladorPrincipal.getInstance().alumnosDelGrupo(jComboBox1.getSelectedItem().toString(), Integer.parseInt(jComboBox2.getSelectedItem().toString()), jYearChooser1.getYear()).iterator();
            Alumno al;
            Object[] obj;
            DefaultTableModel modelo = (DefaultTableModel) jTable2.getModel();
            int filas = jTable2.getRowCount();
            for (int i = 0; i < filas; i++) {
                modelo.removeRow(0);
            }
            while (it.hasNext()) {
                al = it.next();
                Juicio juicio = ControladorPrincipal.getInstance().juicioAlumno(al, jComboBox4.getSelectedItem().toString(), 2, jYearChooser1.getYear());
                obj = new Object[5];
                if (juicio != null) {
                    obj[0] = al;
                    obj[1] = juicio.getJuicio();
                    obj[2] = juicio.getNota();
                    obj[3] = juicio.getJustificadas();
                    obj[4] = juicio.getInjustificadas();
                    jDateChooser2.setDate(juicio.getFecha());
                } else {
                    obj[0] = al;
                    jDateChooser2.setDate(null);
                }
                modelo.addRow(obj);
            }
        } else {
            JOptionPane.showMessageDialog(this, "Debe seleccionar el curso y el grupo", "Error", JOptionPane.ERROR_MESSAGE);
            jComboBox4.setSelectedIndex(-1);
        }
    }//GEN-LAST:event_jComboBox4ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        ArrayList<Juicio> juicios = new ArrayList<Juicio>();
        DefaultTableModel modelo = (DefaultTableModel) jTable2.getModel();
        int filas = jTable2.getRowCount();
        int largos = 0;
        Alumno al;
        if (jDateChooser2.getDate() != null) {
            for (int i = 0; i < filas; i++) {
                if (modelo.getValueAt(i, 1).toString().length() <= 160) {
                    try {
                        al = (Alumno) modelo.getValueAt(i, 0);
                        Juicio juicio = ControladorPrincipal.getInstance().juicioAlumno(al, jComboBox4.getSelectedItem().toString(), 2, jYearChooser1.getYear());
                        if (juicio != null) {
                            juicio.setFecha(jDateChooser2.getDate());
                            juicio.setInjustificadas((Integer) modelo.getValueAt(i, 4));
                            juicio.setJuicio(modelo.getValueAt(i, 1).toString());
                            juicio.setJustificadas((Integer) modelo.getValueAt(i, 3));
                            juicio.setNota((Integer) modelo.getValueAt(i, 2));
                            juicios.add(juicio);
                        } else {
                            Juicio nuevo = new Juicio();
                            nuevo.setAlumno(al);
                            nuevo.setFecha(jDateChooser2.getDate());
                            nuevo.setInjustificadas((Integer) modelo.getValueAt(i, 4));
                            nuevo.setJuicio(modelo.getValueAt(i, 1).toString());
                            nuevo.setJustificadas((Integer) modelo.getValueAt(i, 3));
                            nuevo.setNota((Integer) modelo.getValueAt(i, 2));
                            nuevo.setMateria(jComboBox4.getSelectedItem().toString());
                            nuevo.setReunion(2);
                            juicios.add(nuevo);
                        }
                    } catch (Exception e) {
                    }
                } else {
                    largos++;
                }
            }
            if (largos == 0) {
                if (juicios.size() == filas) {
                    for (int i = 0; i < filas; i++) {
                        ControladorPrincipal.getInstance().guardar(juicios.get(i));
                        modelo.removeRow(0);
                    }
                } else {
                    JOptionPane.showMessageDialog(this, "Existen datos incorrectos", "Error", JOptionPane.ERROR_MESSAGE);
                }
            } else {
                JOptionPane.showMessageDialog(this, "Existen juicios demasiado largos", "Error", JOptionPane.ERROR_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(this, "Debe seleccionar una fecha", "Error", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jComboBox5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox5ActionPerformed
        if (jComboBox1.getSelectedIndex() != -1 && jComboBox2.getSelectedIndex() != -1) {
            Iterator<Alumno> it = ControladorPrincipal.getInstance().alumnosDelGrupo(jComboBox1.getSelectedItem().toString(), Integer.parseInt(jComboBox2.getSelectedItem().toString()), jYearChooser1.getYear()).iterator();
            Alumno al;
            Object[] obj;
            DefaultTableModel modelo = (DefaultTableModel) jTable3.getModel();
            int filas = jTable3.getRowCount();
            for (int i = 0; i < filas; i++) {
                modelo.removeRow(0);
            }
            while (it.hasNext()) {
                al = it.next();
                Juicio juicio = ControladorPrincipal.getInstance().juicioAlumno(al, jComboBox5.getSelectedItem().toString(), 3, jYearChooser1.getYear());
                obj = new Object[5];
                if (juicio != null) {
                    obj[0] = al;
                    obj[1] = juicio.getJuicio();
                    obj[2] = juicio.getNota();
                    obj[3] = juicio.getJustificadas();
                    obj[4] = juicio.getInjustificadas();
                    jDateChooser3.setDate(juicio.getFecha());
                } else {
                    obj[0] = al;
                    jDateChooser3.setDate(null);
                }
                modelo.addRow(obj);
            }
        } else {
            JOptionPane.showMessageDialog(this, "Debe seleccionar el curso y el grupo", "Error", JOptionPane.ERROR_MESSAGE);
            jComboBox5.setSelectedIndex(-1);
        }
    }//GEN-LAST:event_jComboBox5ActionPerformed

    private void jComboBox6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox6ActionPerformed
        if (jComboBox1.getSelectedIndex() != -1 && jComboBox2.getSelectedIndex() != -1) {
            Iterator<Alumno> it = ControladorPrincipal.getInstance().alumnosDelGrupo(jComboBox1.getSelectedItem().toString(), Integer.parseInt(jComboBox2.getSelectedItem().toString()), jYearChooser1.getYear()).iterator();
            Alumno al;
            Object[] obj;
            DefaultTableModel modelo = (DefaultTableModel) jTable4.getModel();
            int filas = jTable4.getRowCount();
            for (int i = 0; i < filas; i++) {
                modelo.removeRow(0);
            }
            while (it.hasNext()) {
                al = it.next();
                Juicio juicio = ControladorPrincipal.getInstance().juicioAlumno(al, jComboBox6.getSelectedItem().toString(), 4, jYearChooser1.getYear());
                obj = new Object[5];
                if (juicio != null) {
                    obj[0] = al;
                    obj[1] = juicio.getJuicio();
                    obj[2] = juicio.getNota();
                    obj[3] = juicio.getJustificadas();
                    obj[4] = juicio.getInjustificadas();
                    jDateChooser4.setDate(juicio.getFecha());
                } else {
                    obj[0] = al;
                    jDateChooser4.setDate(null);
                }
                modelo.addRow(obj);
            }
        } else {
            JOptionPane.showMessageDialog(this, "Debe seleccionar el curso y el grupo", "Error", JOptionPane.ERROR_MESSAGE);
            jComboBox6.setSelectedIndex(-1);
        }
    }//GEN-LAST:event_jComboBox6ActionPerformed

    private void jComboBox7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox7ActionPerformed
        if (jComboBox1.getSelectedIndex() != -1 && jComboBox2.getSelectedIndex() != -1) {
            Iterator<Alumno> it = ControladorPrincipal.getInstance().alumnosDelGrupo(jComboBox1.getSelectedItem().toString(), Integer.parseInt(jComboBox2.getSelectedItem().toString()), jYearChooser1.getYear()).iterator();
            Alumno al;
            Object[] obj;
            DefaultTableModel modelo = (DefaultTableModel) jTable5.getModel();
            int filas = jTable5.getRowCount();
            for (int i = 0; i < filas; i++) {
                modelo.removeRow(0);
            }
            while (it.hasNext()) {
                al = it.next();
                Juicio juicio = ControladorPrincipal.getInstance().juicioAlumno(al, jComboBox7.getSelectedItem().toString(), 5, jYearChooser1.getYear());
                obj = new Object[5];
                if (juicio != null) {
                    obj[0] = al;
                    obj[1] = juicio.getJuicio();
                    obj[2] = juicio.getNota();
                    obj[3] = juicio.getJustificadas();
                    obj[4] = juicio.getInjustificadas();
                    jDateChooser5.setDate(juicio.getFecha());
                } else {
                    obj[0] = al;
                    jDateChooser5.setDate(null);
                }
                modelo.addRow(obj);
            }
        } else {
            JOptionPane.showMessageDialog(this, "Debe seleccionar el curso y el grupo", "Error", JOptionPane.ERROR_MESSAGE);
            jComboBox7.setSelectedIndex(-1);
        }
    }//GEN-LAST:event_jComboBox7ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        ArrayList<Juicio> juicios = new ArrayList<Juicio>();
        DefaultTableModel modelo = (DefaultTableModel) jTable3.getModel();
        int filas = jTable3.getRowCount();
        int largos = 0;
        Alumno al;
        if (jDateChooser3.getDate() != null) {
            for (int i = 0; i < filas; i++) {
                if (modelo.getValueAt(i, 1).toString().length() <= 160) {
                    try {
                        al = (Alumno) modelo.getValueAt(i, 0);
                        Juicio juicio = ControladorPrincipal.getInstance().juicioAlumno(al, jComboBox5.getSelectedItem().toString(), 3, jYearChooser1.getYear());
                        if (juicio != null) {
                            juicio.setFecha(jDateChooser3.getDate());
                            juicio.setInjustificadas((Integer) modelo.getValueAt(i, 4));
                            juicio.setJuicio(modelo.getValueAt(i, 1).toString());
                            juicio.setJustificadas((Integer) modelo.getValueAt(i, 3));
                            juicio.setNota((Integer) modelo.getValueAt(i, 2));
                            juicios.add(juicio);
                        } else {
                            Juicio nuevo = new Juicio();
                            nuevo.setAlumno(al);
                            nuevo.setFecha(jDateChooser3.getDate());
                            nuevo.setInjustificadas((Integer) modelo.getValueAt(i, 4));
                            nuevo.setJuicio(modelo.getValueAt(i, 1).toString());
                            nuevo.setJustificadas((Integer) modelo.getValueAt(i, 3));
                            nuevo.setNota((Integer) modelo.getValueAt(i, 2));
                            nuevo.setMateria(jComboBox5.getSelectedItem().toString());
                            nuevo.setReunion(3);
                            juicios.add(nuevo);
                        }
                    } catch (Exception e) {
                    }
                } else {
                    largos++;
                }
            }
            if (largos == 0) {
                if (juicios.size() == filas) {
                    for (int i = 0; i < filas; i++) {
                        ControladorPrincipal.getInstance().guardar(juicios.get(i));
                        modelo.removeRow(0);
                    }
                } else {
                    JOptionPane.showMessageDialog(this, "Existen datos incorrectos", "Error", JOptionPane.ERROR_MESSAGE);
                }
            } else {
                JOptionPane.showMessageDialog(this, "Existen juicios demasiado largos", "Error", JOptionPane.ERROR_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(this, "Debe seleccionar una fecha", "Error", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        ArrayList<Juicio> juicios = new ArrayList<Juicio>();
        DefaultTableModel modelo = (DefaultTableModel) jTable4.getModel();
        int filas = jTable4.getRowCount();
        int largos = 0;
        Alumno al;
        if (jDateChooser4.getDate() != null) {
            for (int i = 0; i < filas; i++) {
                if (modelo.getValueAt(i, 1).toString().length() <= 160) {
                    try {
                        al = (Alumno) modelo.getValueAt(i, 0);
                        Juicio juicio = ControladorPrincipal.getInstance().juicioAlumno(al, jComboBox6.getSelectedItem().toString(), 4, jYearChooser1.getYear());
                        if (juicio != null) {
                            juicio.setFecha(jDateChooser4.getDate());
                            juicio.setInjustificadas((Integer) modelo.getValueAt(i, 4));
                            juicio.setJuicio(modelo.getValueAt(i, 1).toString());
                            juicio.setJustificadas((Integer) modelo.getValueAt(i, 3));
                            juicio.setNota((Integer) modelo.getValueAt(i, 2));
                            juicios.add(juicio);
                        } else {
                            Juicio nuevo = new Juicio();
                            nuevo.setAlumno(al);
                            nuevo.setFecha(jDateChooser4.getDate());
                            nuevo.setInjustificadas((Integer) modelo.getValueAt(i, 4));
                            nuevo.setJuicio(modelo.getValueAt(i, 1).toString());
                            nuevo.setJustificadas((Integer) modelo.getValueAt(i, 3));
                            nuevo.setNota((Integer) modelo.getValueAt(i, 2));
                            nuevo.setMateria(jComboBox6.getSelectedItem().toString());
                            nuevo.setReunion(4);
                            juicios.add(nuevo);
                        }
                    } catch (Exception e) {
                    }
                } else {
                    largos++;
                }
            }
            if (largos == 0) {
                if (juicios.size() == filas) {
                    for (int i = 0; i < filas; i++) {
                        ControladorPrincipal.getInstance().guardar(juicios.get(i));
                        modelo.removeRow(0);
                    }
                } else {
                    JOptionPane.showMessageDialog(this, "Existen datos incorrectos", "Error", JOptionPane.ERROR_MESSAGE);
                }
            } else {
                JOptionPane.showMessageDialog(this, "Existen juicios demasiado largos", "Error", JOptionPane.ERROR_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(this, "Debe seleccionar una fecha", "Error", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        ArrayList<Juicio> juicios = new ArrayList<Juicio>();
        DefaultTableModel modelo = (DefaultTableModel) jTable5.getModel();
        int filas = jTable5.getRowCount();
        int largos = 0;
        Alumno al;
        if (jDateChooser5.getDate() != null) {
            for (int i = 0; i < filas; i++) {
                if (modelo.getValueAt(i, 1).toString().length() <= 160) {
                    try {
                        al = (Alumno) modelo.getValueAt(i, 0);
                        Juicio juicio = ControladorPrincipal.getInstance().juicioAlumno(al, jComboBox7.getSelectedItem().toString(), 5, jYearChooser1.getYear());
                        if (juicio != null) {
                            juicio.setFecha(jDateChooser5.getDate());
                            juicio.setInjustificadas((Integer) modelo.getValueAt(i, 4));
                            juicio.setJuicio(modelo.getValueAt(i, 1).toString());
                            juicio.setJustificadas((Integer) modelo.getValueAt(i, 3));
                            juicio.setNota((Integer) modelo.getValueAt(i, 2));
                            juicios.add(juicio);
                        } else {
                            Juicio nuevo = new Juicio();
                            nuevo.setAlumno(al);
                            nuevo.setFecha(jDateChooser5.getDate());
                            nuevo.setInjustificadas((Integer) modelo.getValueAt(i, 4));
                            nuevo.setJuicio(modelo.getValueAt(i, 1).toString());
                            nuevo.setJustificadas((Integer) modelo.getValueAt(i, 3));
                            nuevo.setNota((Integer) modelo.getValueAt(i, 2));
                            nuevo.setMateria(jComboBox7.getSelectedItem().toString());
                            nuevo.setReunion(5);
                            juicios.add(nuevo);
                        }
                    } catch (Exception e) {
                    }
                } else {
                    largos++;
                }
            }
            if (largos == 0) {
                if (juicios.size() == filas) {
                    for (int i = 0; i < filas; i++) {
                        ControladorPrincipal.getInstance().guardar(juicios.get(i));
                        modelo.removeRow(0);
                    }
                } else {
                    JOptionPane.showMessageDialog(this, "Existen datos incorrectos", "Error", JOptionPane.ERROR_MESSAGE);
                }
            } else {
                JOptionPane.showMessageDialog(this, "Existen juicios demasiado largos", "Error", JOptionPane.ERROR_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(this, "Debe seleccionar una fecha", "Error", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        ArrayList<Juicio> juicios = new ArrayList<Juicio>();
        DefaultTableModel modelo = (DefaultTableModel) jTable6.getModel();
        int filas = jTable6.getRowCount();
        Alumno al;
        if (jDateChooser6.getDate() != null) {
            for (int i = 0; i < filas; i++) {
                try {
                    al = (Alumno) modelo.getValueAt(i, 0);
                    Juicio juicio = ControladorPrincipal.getInstance().juicioAlumno(al, "General", 6, jYearChooser1.getYear());
                    if (juicio != null) {
                        juicio.setJuicio(modelo.getValueAt(i, 1).toString());
                        juicio.setFecha(jDateChooser6.getDate());
                        juicios.add(juicio);
                    } else {
                        Juicio nuevo = new Juicio();
                        nuevo.setAlumno(al);
                        nuevo.setFecha(jDateChooser6.getDate());
                        nuevo.setJuicio(modelo.getValueAt(i, 1).toString());
                        nuevo.setMateria("General");
                        nuevo.setReunion(6);
                        juicios.add(nuevo);
                    }
                } catch (Exception e) {
                }
            }
            if (juicios.size() == filas) {
                for (int i = 0; i < filas; i++) {
                    ControladorPrincipal.getInstance().guardar(juicios.get(i));
                    modelo.removeRow(0);
                }
            } else {
                JOptionPane.showMessageDialog(this, "Existen datos incorrectos", "Error", JOptionPane.ERROR_MESSAGE);
            }
        } else {
            JOptionPane.showMessageDialog(this, "Debe seleccionar una fecha", "Error", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jButton6ActionPerformed
    private void jComboBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBox2ActionPerformed
        jDateChooser1.setDate(null);
        jDateChooser2.setDate(null);
        jDateChooser3.setDate(null);
        jDateChooser4.setDate(null);
        jDateChooser5.setDate(null);

        DefaultTableModel modeloT;
        modeloT = (DefaultTableModel) jTable1.getModel();
        int filas = modeloT.getRowCount();
        for (int i = 0; i < filas; i++) {
            modeloT.removeRow(0);
        }
        modeloT = (DefaultTableModel) jTable2.getModel();
        filas = modeloT.getRowCount();
        for (int i = 0; i < filas; i++) {
            modeloT.removeRow(0);
        }
        modeloT = (DefaultTableModel) jTable3.getModel();
        filas = modeloT.getRowCount();
        for (int i = 0; i < filas; i++) {
            modeloT.removeRow(0);
        }
        modeloT = (DefaultTableModel) jTable4.getModel();
        filas = modeloT.getRowCount();
        for (int i = 0; i < filas; i++) {
            modeloT.removeRow(0);
        }
        modeloT = (DefaultTableModel) jTable5.getModel();
        filas = modeloT.getRowCount();
        for (int i = 0; i < filas; i++) {
            modeloT.removeRow(0);
        }
        if (jComboBox2.getSelectedIndex() != -1) {
            Iterator<Alumno> it = ControladorPrincipal.getInstance().alumnosDelGrupo(jComboBox1.getSelectedItem().toString(), Integer.parseInt(jComboBox2.getSelectedItem().toString()), jYearChooser1.getYear()).iterator();
            Alumno al;
            Object[] obj;
            DefaultTableModel modelo = (DefaultTableModel) jTable6.getModel();
            filas = jTable6.getRowCount();
            for (int i = 0; i < filas; i++) {
                modelo.removeRow(0);
            }
            while (it.hasNext()) {
                al = it.next();
                Juicio juicio = ControladorPrincipal.getInstance().juicioAlumno(al, "General", 6, jYearChooser1.getYear());
                obj = new Object[2];
                if (juicio != null) {
                    obj[0] = al;
                    obj[1] = juicio.getJuicio();
                    jDateChooser6.setDate(juicio.getFecha());
                } else {
                    obj[0] = al;
                    jDateChooser6.setDate(null);
                }
                modelo.addRow(obj);
            }
        }
    }//GEN-LAST:event_jComboBox2ActionPerformed

    private void jTable1PropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jTable1PropertyChange
    }//GEN-LAST:event_jTable1PropertyChange
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBox3;
    private javax.swing.JComboBox jComboBox4;
    private javax.swing.JComboBox jComboBox5;
    private javax.swing.JComboBox jComboBox6;
    private javax.swing.JComboBox jComboBox7;
    private com.toedter.calendar.JDateChooser jDateChooser1;
    private com.toedter.calendar.JDateChooser jDateChooser2;
    private com.toedter.calendar.JDateChooser jDateChooser3;
    private com.toedter.calendar.JDateChooser jDateChooser4;
    private com.toedter.calendar.JDateChooser jDateChooser5;
    private com.toedter.calendar.JDateChooser jDateChooser6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTable3;
    private javax.swing.JTable jTable4;
    private javax.swing.JTable jTable5;
    private javax.swing.JTable jTable6;
    private com.toedter.calendar.JYearChooser jYearChooser1;
    // End of variables declaration//GEN-END:variables
}
